﻿
@{
    ViewData["Title"] = "运营商选择";
}

<div class="mini-toolbar" style="padding:2px;border-bottom:0;">
    <table style="width:100%;">
        <tr>
            <td style="white-space:nowrap;">
                <label style="font-family:Verdana;">运营商编号: </label>
                <input class="mini-textbox" id="org_code" name="org_code" />
                <label style="font-family:Verdana;">运营商名称: </label>
                <input class="mini-textbox" id="org_name" name="org_name" />
                <a class="mini-button" iconCls="icon-search" plain="true" onclick="onSearch()">查询</a>
            </td>
        </tr>
    </table>
</div>
<!--撑满页面-->
<div class="mini-fit">
    <div id="datagrid1" class="mini-datagrid" url="/Fnc/Receipt/SelectYYajax"
         allowResize="true" pageSize="20" allowCellEdit="true" allowCellSelect="true" multiSelect="false"
         editNextOnEnterKey="true" editNextRowCell="true" idField="org_id" style="width:100%;height:100%;" onrowdblclick="onRowdblClick">
        <div property="columns">
            <div type="checkcolumn" width="10"></div>
            <div field="org_id" width="60" visible="false">运营商Id</div>
            <div field="org_code" width="60">运营商编号</div>
            <div field="org_name" width="60">运营商名称</div>
        </div>
    </div>
</div>
<div class="mini-toolbar" style="text-align:center;padding-top:8px;padding-bottom:8px;" borderStyle="border:0;">
    <a class="mini-button" style="width:60px;" onclick="onOk()">确定</a>
    <span style="display:inline-block;width:25px;"></span>
    <a class="mini-button" style="width:60px;" onclick="cancelClick()">取消</a>
</div>
<script type="text/javascript">
    mini.parse();

    // 双击编辑
    function onRowdblClick(e) {
        var grid = mini.get("datagrid1");
        var data = grid.getSelected();
        sx.winClose({ org_id: data.org_id, org_name: data.org_name, org_code: data.org_code });
    }
    function onOk(e) {
        var grid = mini.get("datagrid1");
        var data = grid.getSelected();
        if (data == null) {
            sx.error("请选择行！");
            return;
        }
        sx.winClose({ org_id: data.org_id, org_name: data.org_name, org_code: data.org_code });
    }

    function onSearch() {
        var org_code = mini.get("org_code").getValue();
        var org_name = mini.get("org_name").getValue();
        mini.get("datagrid1").load({ org_code: org_code, org_name: org_name });
    }

    function closeClick() {
        sx.winClose({ success: true });
    }
    function cancelClick() {
        sx.winCancel();
    }
</script>



